cmake_minimum_required(VERSION 3.10)

# set the project name and version
project(DSHFDM VERSION 1.0)

# specify the C++ standard
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED True)

# configure a header file to pass some of the CMake settings to the source code
configure_file(DSHFDMConfig.h.in DSHFDMConfig.h)

# add the library
add_subdirectory(vars)
add_subdirectory(readFile)
# add_subdirectory(solvers)
add_subdirectory(diff)
add_subdirectory(solve)
add_subdirectory(mesh)
list(APPEND EXTRA_LIBS readFile)
# list(APPEND EXTRA_LIBS newVar)
# list(APPEND EXTRA_LIBS delVar)
# list(APPEND EXTRA_LIBS initVars)
# list(APPEND EXTRA_LIBS diff2d)
# list(APPEND EXTRA_LIBS fdmU2d)


# add the executable
add_executable(${PROJECT_NAME} main.cxx)
target_link_libraries(${PROJECT_NAME} PUBLIC ${EXTRA_LIBS})

# add the binary tree to the search path for include files
# so that we will find TutorialConfig.h
target_include_directories(${PROJECT_NAME} PUBLIC
                           "${PROJECT_BINARY_DIR}"
                           )

set(CMAKE_INSTALL_PREFIX ..)
install(TARGETS ${PROJECT_NAME} DESTINATION bin)
